package com.wxy.demo.enums;

import lombok.Getter;

@Getter
public enum DatasourceTypeEnum {
    MYSQL("mysql", "com.mysql.cj.jdbc.Driver", "jdbc:mysql://%s:%s/%s?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai"),
    ORACLE("oracle", "oracle.jdbc.driver.OracleDriver", "jdbc:oracle:thin:@%s:%s:%s"),
    SQLSERVER("sqlserver", "com.microsoft.sqlserver.jdbc.SQLServerDriver", "jdbc:sqlserver://%s:%s;databasename=%s"),
    POSTGRESQL("postgresql", "org.postgresql.Driver", "jdbc:postgresql://%s:%s/%s");

    private final String type;
    private final String driverClassName;
    private final String urlFormat;

    DatasourceTypeEnum(String type, String driverClassName, String urlFormat) {
        this.type = type;
        this.driverClassName = driverClassName;
        this.urlFormat = urlFormat;
    }
}
